<?php
$route->any('login', 'AuthController@login');

//token
$route->any('qiniu/token', 'QiNiuController@getToken');

$route->any('admin/store', 'AdminController@store');

$route->group(['middleware' => 'api.auth'], function ($route) {
    //管理员
    $route->any('admin/info', 'AdminController@info');
    $route->any('admin/destroy', 'AdminController@destroy');
    $route->any('logout', 'AdminController@logout');
    $route->any('password/update', 'AdminController@updatePwd');
    $route->any('reset/password', 'AdminController@resetPassword');

    $route->any('permission', 'AuthController@permission');

    //category
    $route->any('category/index', 'CategoryController@index');

    //cookbook
    $route->any('cookbook/index', 'CookbookController@index');
    $route->any('cookbook/info', 'CookbookController@info');
    $route->any('cookbook/store', 'CookbookController@store');
    $route->any('cookbook/destroy', 'CookbookController@destroy');
    $route->any('cookbook/isOn', 'CookbookController@isOn');

    $route->get('video/budget', 'CookbookAdvViewController@budget_index');

    //flow
    $route->any('flow', 'BalanceController@index');

    //提现
    $route->any('withdraw/apply', 'WithdrawController@apply');
    $route->any('withdraw/index', 'WithdrawController@index');

    $route->any('merchant/child', 'MerchantController@child');

    # ============================= api ===================================

    $route->any('init', 'InitController@init');
    $route->any('producer/ads', 'ProducerAdsController@store');
    $route->any('producer/ads/index', 'ProducerAdsController@index');
    $route->any('producer/ads/info', 'ProducerAdsController@info');
    $route->any('producer/ads/destroy', 'ProducerAdsController@destroy');

    //报名
    $route->any('adv/sign/up', 'SignUpController@store');
    $route->any('adv/sign/up/supply', 'SignUpController@store');
    //已报名列表
    $route->any('adv/sign/up/list', 'SignUpController@index');
    $route->any('adv/order/info', 'SignUpController@order_info');
    $route->any('adv/order/remark', 'SignUpController@remark');
    $route->any('adv/order/url', 'SignUpController@url');
    //流水
    $route->any('adv/flow', 'SignUpController@adv_flow');

    //达人
    $route->any('merchant/index', 'MerchantController@index');
    $route->any('merchant/info', 'MerchantController@info');

    //邀请
    $route->any('adv/invite/store', 'AdvInviteController@store');
    $route->any('adv/invite/index', 'AdvInviteController@index');

    //product
    $route->any('product/index', 'ProductController@index');

});

